<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// This tests that when a selection that starts at [replaced element, 1] is
// painted, the replaced element doesn't appear selected. This test uses an
// image for the replaced element.
selection_test(
    '<div contenteditable>abc<img src="../resources/abe.png">def|</div>',
    selection => selection.modify('extend', 'backward', 'character'),
    '<div contenteditable>abc<img src="../resources/abe.png">de|f^</div>');
selection_test(
    '<div contenteditable>abc<img src="../resources/abe.png">de|f^</div>',
    selection => selection.modify('extend', 'backward', 'character'),
    '<div contenteditable>abc<img src="../resources/abe.png">d|ef^</div>');
selection_test(
    '<div contenteditable>abc<img src="../resources/abe.png">d|ef^</div>',
    selection => selection.modify('extend', 'backward', 'character'),
    '<div contenteditable>abc<img src="../resources/abe.png">|def^</div>');
selection_test(
    '<div contenteditable>abc<img src="../resources/abe.png">|def^</div>',
    selection => selection.modify('extend', 'backward', 'character'),
    '<div contenteditable>abc|<img src="../resources/abe.png">def^</div>');
</script>
